package cn.fjy.android.phone.worker;

import android.os.Vibrator;

/**
 * 震动定时任务
 * 
 * @author GrayF
 * 
 */

class VibratorTTRemind implements Runnable {

	private Vibrator vibrator;
	
	private boolean isEnable = true;


	public VibratorTTRemind(Vibrator vibrator) {
		this.vibrator = vibrator;
	}
	
	public void setEnable(boolean isEnable) {
		this.isEnable = isEnable;
	}

	@Override
	public void run() {
	
		while(true){
			try {
				Thread.sleep(45000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			if(isEnable){
				vibrator.vibrate(100);
			}else{
				break;
			}
		}
		
	}
}